<%@page import="com.liangzi.project.constants.SystemConstants"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="../head/head.jsp"%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>立即申请</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="<%=basePath %>/static/css/sqktpd.css?v=1.7" />
		<style>.demo{margin:0 auto;background-color: #fafafa;}
		#l-map{height:375px;float:left;border:1px solid #bcbcbc;}
		</style>
	</head>

	<body>
		<!-- <header class="main-header">
			<div class="row">
				<div class="s2 header-back">
					<a class="shadow" href="javascript:history.go(-1);">
						<i class="icon-back"></i>
					</a>
				</div>
				<div class="s8 header-title">申请开通频道</div>
				<div class="s2 header-home">
					<a class="shadow" href="#"></a>
				</div>
			</div>
		</header>-->
		<div class="mainPage">
			<div class="notice">
				<div class="ne-title">
					<div class="sqtz">申请须知</div>
				</div>
				<div class="ne-cont">1.申请开通频道需要提交营业执照，身份证明等文件;</div>
				<div class="ne-cont">2.您需要支付第三方审核费用300元;</div>
				<div class="ne-cont">3.频道公司会严格保密申请资料。</div>
			</div>
			<div class="channelCont">
				<div class="chact-title">频道封面<span>支持各种格式，文件大小低于4M</span></div>
				<div class="icon-cover" id="pdfm" style="padding-right: 0;">
					<i class="icon-plus"></i>
				</div>
				<div class="chact-width borderTop chact-div" style="margin-top: 15px;">
					<span class="disinbolck">频道名称</span><input type="text" class="pdmcValue" placeholder="1~18个字符" maxlength="18"/>
				</div>
				<div class="chact-classification borderTop chact-div">
					行业分类<input type="hidden" /><span class="region hyfn"><span class="hyfl1"></span><span class="hyfl2"></span><span class="hyfl3"></span><span class="hyTips"> 请选择</span><i class="icon-right"></i></span>
				</div>
				<div class="chact-div borderTop selectCity" style="">
					城市<span class="region cityLink1"><span class="provinceName"></span><span class="cityName"></span><span class="areaName"></span><span class="areaTips"> 请选择</span><i class="icon-right"></i></span>
				</div>
				<div class="chact-div borderTop chact-width">
					<span class="disinbolck">详细地址</span><input type="text" class="detailedAddress" placeholder="输入商户详细地址更容易被推荐" />
				</div>
				<div class="chact-div borderTop address clearfix" style="margin-bottom: 0;">
					插入地图<span class="chanct-modify">修改<i class="icon-right"></i></span>
				</div>
				<div class="mapTips">频道是一款全新的时空社交产品，鉴于AR红包的现场属性，须用户精准定位店面所在位置！</div>
			</div>
			<div class="residentInformation">
				<!--
				<div class="chact-div borderTop chact-width zpstyle" style="border-top: none;">
					<span class="disinbolck">频道居民号</span><input type="text" class="jmidVaule" placeholder="该居民将成为频道的超级管理员" style="width: 187px;" />
				</div>
				 -->
				<div class="chact-div borderTop chact-width">
					<span class="disinbolck">申请人姓名</span><input type="text" class="frxmVaule" placeholder="请填写申请人姓名" />
				</div>
				<div class="chact-div borderTop chact-width">
					<span class="disinbolck">联系人手机</span><input type="tel" class="lxrsjVaule" placeholder="审核确认使用，频道将为您严格保密" />
				</div>
				<!--
				<div class="chact-div borderTop chact-width zpstyle">
					<span class="disinbolck">身份证号码</span><input type="text" class="sfzVaule" placeholder="开通频道需要实名申请" />
				</div>

				<div class="chact-div borderTop chact-width">
					<span class="disinbolck">对公账号</span><input type="text" class="dgzhVaule" placeholder="结款专用,请使用营业执照公司对公账号" style="width: 227px;" />
				</div>
				 -->
				<div class="chact-div borderTop rf-card" style="padding-top: 15px;">
					营业执照
					<div class="idcard">
						<!--<span class="icon-cover icon-cover2" id="sfz">
			    			<i class="icon-plus icon-plus2"></i>
			    			<div class="icdiv">点击上传身份证</div>
			    		</span>-->
						<span class="icon-cover icon-cover2" id="yyzz">
			    			<i class="icon-plus icon-plus2"></i>
			    			<div class="icdiv">点击上传营业执照</div>
		    			</span>
		    			<div style="clear: both;"></div>
					</div>
				</div>
			</div>
			<div class="invitationCode" style="">
				<!--<div class="chact-div borderTop chact-width">
					<span class="disinbolck">邀请码</span><input class="yqm" type="text" placeholder="输入邀请码，0元开通频道" />
				</div>-->
				<div class="chact-div rf-card">
					认证费
					<span style="color: #999;font-size: 14px;float: right;padding-right: 16px;">当前为活动期间，免认证费</span>
					<span class="redcolor" style="text-decoration:line-through;">300 元</span>
				</div>
			</div>
			<div class="mainbottom">
				<div class="ktBtn disableBtn">确认开通</div>
				<div class="icdiv">频道公司收到申请后尽快为您审核，通知到您的频道app</div>
			</div>
		</div>
		<!--城市列表-->
		<div class="cityLayer" style="display: none;">
			<div class="sqktcity residentInformation">
				<header class="main-header">
					<div class="row">
						<div class="s2 header-back"  style="margin-left: 0;">
							<a class="shadow" href="javascript:history.go(-1);">
								<!--<i class="icon-back"></i>-->
							</a>
						</div>
						<div class="s8 header-title">选择城市</div>
						<div class="s2 header-home" style="height: 36px;line-height: 36px;">
							<a class="shadow" href="javascript:;"><i class="icon-clear cityBack"></i></a>
						</div>
					</div>
				</header>
				<ul class="province">
				</ul>
			</div>
		</div>
		<div class="hyflLayer" style="display: none;">
			<div class="sqkthyfl residentInformation">
				<header class="main-header">
					<div class="row">
						<div class="s2 header-back"  style="margin-left: 0;">
							<a class="shadow" href="javascript:history.go(-1);">
								<!--<i class="icon-back"></i>-->
							</a>
						</div>
						<div class="s8 header-title">行业分类</div>
						<div class="s2 header-home" style="height: 36px;line-height: 36px;">
							<a class="shadow" href="javascript:;"><i class="icon-clear hyflBack"></i></a>
						</div>
					</div>
				</header>
				<ul class="hyfl1-list">
				</ul>
			</div>
		</div>
		<!--地图-->
		<div class="mapLayer" style="display: none;">
			<div class="demo">
				<header class="main-header">
					<div class="row">
						<div class="s2 header-back"  style="margin-left: 0;">
							<a class="shadow" href="javascript:history.go(-1);">
								<!--<i class="icon-back"></i>-->
							</a>
						</div>
						<div class="s8 header-title" style="width: 56%;">插入地图</div>
						<div class="s2 header-home" style="height: 36px;line-height: 36px;">
							<!--<a class="shadow" href="javascript:;"><i class="icon-clear mapBack"></i></a>-->
							<i class="icon-clear mapBack"></i>
						</div>
					</div>
				</header>
				<div class="searchbar">
					<div class="search-bar" id="searchBar">
							<div class="search-bar__form">
							<div class="search-bar__box">
			                    <i class="icon-search"></i>
			                    <input type="search" class="search-bar__input" id="searchInput" placeholder="输入位置">
			                    <a href="javascript:void(0);" class="icon-clear" id="searchClear"></a>
			                </div>
			                <label class="search-bar__label" id="searchText">
			                    <i class="icon-search"></i>
			                    <span style="margin: 4px 0 4px 0;">输入位置</span>
			                </label>
			               </div>
					</div>
					<div class="searchbar-result2" id="searchResult2">
						<ul class="sr2Ul">
						</ul>
					</div>
				</div>
				<div style="position: relative;">
					<div id="l-map" class="map-body"></div>
				</div>
				<div class="searchbar-result" id="searchResult">
		            <ul class="srUl">
		            </ul>
		        </div>
			</div>
		</div>
		<!--申请成功-->
	    <div class="windowDiv"  style="display:none">
	       <div  class="inWindow">
           <div class="wdTitle"><i class="icon-ok"></i>申请成功</div>
           <div class="wdcontent">请等待频道官方为您审核</div>
           <div class="isOk">确认</div>
	       </div>
	    </div>
		<script type="text/javascript" src="<%=basePath %>/static/js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>/static/js/webuploader.min.js?v=1.7" ></script>
		<script type="text/javascript" src="<%=basePath %>/static/js/aseoe_liangce.js"></script>
		<script type="text/javascript" src="<%=shceme %>://api.map.baidu.com/api?v=2.0&ak=7O8b0PRhlsKk2BcxrE4GaEnopTkPcdc1&s=1"></script>
		<script type="text/javascript" src="<%=basePath %>/static/js/map.js?v=1.7" ></script>
		<script>
		$(function(){
			var hh = window.innerHeight - 303;
			  $('#searchResult').height(hh);

			  var tcch = window.innerHeight - 40;
			  $('.province').height(tcch);

			$(window).resize(function(){
			  var hh = window.innerHeight - 303;
			  $('#searchResult').height(hh);

			  var tcch = window.innerHeight - 40;
			  $('.province').height(tcch);
			});
			var $provinceName = $('body').data('areID')
			var $cityName = $('body').data('cityID')
			var $areaName = $('body').data('provinceID')

			if($provinceName && $cityName && $areaName) {
				$('.provinceName').text($provinceName);
				$('.cityName').text($cityName);
				$('.areaName').text($areaName);
			}
			$('.chanct-modify').click(function() {
				$('.mapLayer').show();
				$('html,body').css({
				    'overflow':'hidden',
				    'height': '100%'
				});
				$('body').css('position','relative');
				getPoint();
			})
			$('.selectCity').click(function() {
				$('.cityLayer').show();
			});
			$('.hyfn').click(function() {
				$('.hyflLayer').show();
			});
			$('.yqm').on('input', function() {
				if($.trim($(this).val()) != ""){
					$('.redcolor').text('0 元');
				}else{
					$('.redcolor').text('300 元');
				}
			})
			$('.isOk').click(function(){
				$('.windowDiv').hide();
				history.go(-1);
			})
			/*地区*/
			diqu();
			function diqu(){
			$.ajax({
				type:"post",
				dataType:"json",
				url:"<%=basePath %>/apply/queryCity",
				success: function(response) {
					var _str = '';
                	var reDate = response.data;
                	$.each(reDate, function(i, ele) {
                		_str += '<li class="provinceLi">';
    					_str+='<div class="cq-div chact-width zpstyle">';
    					_str+='<span class="disinbolck" data-prov-name="'+ele.name+'" data-prov-code="'+ele.code+'">'+ele.name+'</span></div>';
    					_str+='<div class="borderTop padLeft"></div>';
    					if(ele.children.length>0){
    						_str+='<ul class="city-list" style="display: none;">';
    						$.each(ele.children, function(i2, ele2){
	    						_str+='<li class="cityLi">';
		    					_str+='<div class="cq-div" data-city-name="'+ele2.name+'" data-city-code="'+ele2.code+'">'+ele2.name+'</div>';
		    					_str+='<div class="borderTop padLeft"></div>';
		    					if(ele2.children.length>0){
		    						_str+='<ul class="area-list" style="display: none;">';
		    						$.each(ele2.children, function(i3, ele3){
			    						_str+='<li class="areaLi">';
				    					_str+='<div class="cq-div" data-area-name="'+ele3.name+'" data-area-code="'+ele3.code+'">'+ele3.name+'</div>';
				    					_str+='<div class="borderTop padLeft"></div>';
				    					_str+='</li>';
		    						});
		    						_str+='</ul>';
		    					}
		    					_str+='</li>';
    						});
	    					_str+='</ul>';
    					}
    					_str+='</li>';
                	});
                	$('.province').html(_str);
                	djcz();
	            },
	            error: function(response) {
	            }
			});
		}
			/*行业*/
			hyfl();
			function hyfl(){
				$.ajax({
				type:"post",
				dataType:"json",
				url:"<%=basePath %>/apply/queryIndustry",
				success: function(response) {
					var _str1 = '';
                	var hyDate = response.data;
                	$.each(hyDate, function(i, ele) {
                		_str1 += '<li>';
    					_str1+='<div class="cq-div chact-width zpstyle">';
    					_str1+='<span class="disinbolck" data-hy1-name="'+ele.name+'" data-hy1-code="'+ele.code+'">'+ele.name+'</span></div>';
    					_str1+='<div class="borderTop padLeft"></div>';
    					if(ele.children.length>0){
    						_str1+='<ul class="hyfl2-list" style="display: none;">';
    						$.each(ele.children, function(i2, ele2){
	    						_str1+='<li>';
		    					_str1+='<div class="cq-div" data-hy2-name="'+ele2.name+'" data-hy2-code="'+ele2.code+'">'+ele2.name+'</div>';
		    					_str1+='<div class="borderTop padLeft"></div>';
		    					if(ele2.children.length>0){
		    						_str1+='<ul class="hyfl3-list" style="display: none;">';
		    						$.each(ele2.children, function(i3, ele3){
			    						_str1+='<li>';
				    					_str1+='<div class="cq-div" data-hy3-name="'+ele3.name+'" data-hy3-code="'+ele3.code+'">'+ele3.name+'</div>';
				    					_str1+='<div class="borderTop padLeft"></div>';
				    					_str1+='</li>';
		    						});
		    						_str1+='</ul>';
		    					}
		    					_str1+='</li>';
    						});
	    					_str1+='</ul>';
    					}
    					_str1+='</li>';
                	});
                	$('.hyfl1-list').html(_str1);
                	djcz2();
	            },
	            error: function(response) {
	            }
			});
			}
			function djcz2(){
				/*选择行业*/
				$('.hyfl1-list').children('li').each(function() {
				$(this).children('.cq-div').on('click', function() {
					var $this = $(this);
					var citylist = $this.next('.borderTop').next('.hyfl2-list');
					if(citylist.length == 0 && !$this.hasClass('active')){
						var hyfl1 = $this.find('.disinbolck').data('hy1-name');
						var hyfl1Code = $this.find('.disinbolck').data('hy1-code');
						$('body').data('hyfl1Code',hyfl1Code);
						$('.hyfl1').text('');
						$('.hyfl2').find('span').text('');
						$('.hyfl3').text('');
						$('.hyfl1').text(hyfl1);
						$('.hyTips').hide();
						inputValue();
						$('.hyflLayer').hide();
					}else{
						showOrHideAccordion3($this);
					}
				});
			});
			$('.hyfl2-list').children('li').each(function() {
				$(this).children('.cq-div').on('click', function() {
					var $this = $(this);
					var arealist = $this.next('.borderTop').next('.hyfl3-list');
					if(arealist.length == 0 && !$this.hasClass('active2')){
						var cityID = $this.data('hy2-name');
						var cityCode = $this.data('hy2-code');
						var provinceID = $this.parents().parents('.hyfl2-list').prevAll('.cq-div').find('.disinbolck').data('hy1-name');
						var provinceCode = $this.parents().parents('.hyfl2-list').prevAll('.cq-div').find('.disinbolck').data('hy1-code');
						$('body').data('city1Code',cityCode);
						$('body').data('hyfl1Code',provinceCode);
						console.log(cityID+""+provinceID)
						$('.hyfl1').text('');
						$('.hyfl2').find('span').text('');
						$('.hyfl3').text('');
						$('.hyfl1').text(provinceID);
						$('.hyfl2').html('<span style="padding: 0 10px 0 10px">'+cityID+'</span>');
						$('.hyTips').hide();
						inputValue();
						$('.hyflLayer').hide();
					}else{
						showOrHideAccordion4($this);
					}
				});
			});
			$('.hyfl3-list').children('li').each(function() {
				$(this).children('.cq-div').on('click', function() {
					var $this = $(this);
					var areID = $this.data('hy3-name');
					var are1Code = $this.data('hy3-code');
					var cityID = $this.parents('.hyfl3-list').prevAll('.cq-div').data('hy2-name');
					var cityCode = $this.parents('.hyfl3-list').prevAll('.cq-div').data('hy2-code');
					var provinceID = $this.parents('.hyfl3-list').parents('.hyfl2-list').prevAll('.cq-div').find('.disinbolck').data('hy1-name');
					var provinceCode = $this.parents('.hyfl3-list').parents('.hyfl2-list').prevAll('.cq-div').find('.disinbolck').data('hy1-code');
					$('body').data('are1Code',are1Code);
					$('body').data('hyfl1Code',provinceCode);
					$('body').data('city1Code',cityCode);
					$('.mainPage').show();
					$('.hyTips').hide();
					$('.hyfl1').text(provinceID);
					$('.hyfl2').html('<span style="padding: 0 10px 0 10px">'+cityID+'</span>');
					$('.hyfl3').text(areID);
					inputValue();
					$('.hyflLayer').hide();
				});
			});
			}
			function djcz(){
				/*选择地区*/
			$('.province').children('li').each(function() {
				$(this).children('.cq-div').on('click', function() {
					var $this = $(this);
					var citylist = $this.next('.borderTop').next('.city-list');
					if(citylist.length == 0 && !$this.hasClass('active')){
						var provinceID = $this.find('.disinbolck').data('prov-name');
						var provinceCode = $this.find('.disinbolck').data('prov-code');
						$('body').data('preCode',provinceCode);
						$('.provinceName').text('');
						$('.cityName').find('span').text('');
						$('.areaName').text('');
						$('.provinceName').text(provinceID);
						$('.areaTips').hide();
						$('.mainPage').show();
						inputValue();
						$('.cityLayer').hide();
					}else{
						showOrHideAccordion($this);
					}
				});
			});
			$('.city-list').children('li').each(function() {
				$(this).children('.cq-div').on('click', function() {
					var $this = $(this);
					var arealist = $this.next('.borderTop').next('.area-list');
					if(arealist.length == 0 && !$this.hasClass('active2')){
						var cityID = $this.data('city-name');
						var provinceID = $this.parents().parents('.city-list').prevAll('.cq-div').find('.disinbolck').data('prov-name');
						var cityCode = $this.data('city-code');
						var provinceCode = $this.parents().parents('.city-list').prevAll('.cq-div').find('.disinbolck').data('prov-code');
						$('body').data('preCode',provinceCode);
						$('body').data('ctCode',cityCode);
						$('.provinceName').text('');
						$('.cityName').find('span').text('');
						$('.areaName').text('');
						$('.provinceName').text(provinceID);
						$('.cityName').html('<span style="padding: 0 10px 0 10px">'+cityID+'</span>');
						$('.areaTips').hide();
						$('.mainPage').show();
						inputValue();
						$('.cityLayer').hide();
					}else{
						showOrHideAccordion2($this);
					}
				});
			});
			$('.area-list').children('li').each(function() {
				$(this).children('.cq-div').on('click', function() {
					var $this = $(this);
					var areID = $this.data('area-name');
					var cityID = $this.parents('.area-list').prevAll('.cq-div').data('city-name');
					var provinceID = $this.parents('.area-list').parents('.city-list').prevAll('.cq-div').find('.disinbolck').data('prov-name');
					var areCode1 = $this.data('area-code');
					var cityCode = $this.parents('.area-list').prevAll('.cq-div').data('city-code');
					var provinceCode = $this.parents('.area-list').parents('.city-list').prevAll('.cq-div').find('.disinbolck').data('prov-code');
					$('body').data('areCode',areCode1);
					$('body').data('ctCode',cityCode);
					$('body').data('preCode',provinceCode);
					$('.mainPage').show();
					$('.areaTips').hide();
					$('.provinceName').text(provinceID);
					$('.cityName').html('<span style="padding: 0 10px 0 10px">'+cityID+'</span>');
					$('.areaName').text(areID);
					inputValue();
					$('.cityLayer').hide();
				});
			});
			 $('.province .provinceLi:last .borderTop').css('border','none');
			}
			// 显示或隐藏Accordion
			function showOrHideAccordion(el) {
				var $subList = el.nextAll('.city-list');
				var $border = el.next('.padLeft');
				var $parLi = el.parent('li');
				if($subList.is(':visible')) {
					$border.addClass('borderTop');
					el.removeClass('active');
					$subList.slideUp(250);
					$parLi.siblings('li').show();
				} else {
					$border.removeClass('borderTop');
					el.addClass('active');
					$subList.slideDown(250);
					$parLi.siblings('li').hide();
				}
			}

			function showOrHideAccordion2(el) {
				var $subList = el.nextAll('.area-list');
				var $border = el.next('.padLeft');
				var $parLi = el.parent('li');
				if($subList.is(':visible')) {
					$border.addClass('borderTop');
					el.removeClass('active2');
					$subList.slideUp(250);
					$parLi.siblings('li').show();
				} else {
					$border.removeClass('borderTop');
					el.addClass('active2');
					$subList.slideDown(250);
					$parLi.siblings('li').hide();
				}
			};
			function showOrHideAccordion3(el) {
				var $subList = el.nextAll('.hyfl2-list');
				var $border = el.next('.padLeft');
				var $parLi = el.parent('li');
				if($subList.is(':visible')) {
					$border.addClass('borderTop');
					el.removeClass('active');
					$subList.slideUp(250);
					$parLi.siblings('li').show();
				} else {
					$border.removeClass('borderTop');
					el.addClass('active');
					$subList.slideDown(250);
					$parLi.siblings('li').hide();
				}
			}

			function showOrHideAccordion4(el) {
				var $subList = el.nextAll('.hyfl3-list');
				var $border = el.next('.padLeft');
				var $parLi = el.parent('li');
				if($subList.is(':visible')) {
					$border.addClass('borderTop');
					el.removeClass('active2');
					$subList.slideUp(250);
					$parLi.siblings('li').show();
				} else {
					$border.removeClass('borderTop');
					el.addClass('active2');
					$subList.slideDown(250);
					$parLi.siblings('li').hide();
				}
			};
			$('.icon-back').click(function(){
				if(!$('.mainPage').is(':visible')){
					$('.mainPage').show();
					$('.main-header').show();
					$('.demo').hide();
				}
			})
			$('.cityBack').click(function(){
				$('.cityLayer').hide();
			})
			$('.hyflBack').click(function(){
				$('.hyflLayer').hide();
			})
			$('.mapBack').click(function(){
				$('.mapLayer').hide();
				$('html,body').css({
			    	'overflow':'auto',
			    	'height': 'auto'
				});
				$('body').css('position','static');
			})
			$('.dituBack,.qdLocation').click(function(){
				if(!$('.mainPage').is(':visible')){
					$('.mainPage').show();
				}
			})
			/*上传图片*/
			var uploader = WebUploader.create({
			// 选完文件后，是否自动上传。
		    auto: true,
		    // 文件接收服务端。
		    server: '<%=basePath %>/apply/upload',
		    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
		    pick: '#pdfm',
		    // 参数
            formData: {file: ''},
		    // 去重复
            duplicate: false,
		    // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
		    resize: false,
		    // 只允许选择图片文件。
		    accept: {
		        extensions: 'gif,jpg,jpeg,bmp,png'
		    },
			thumb: {
		    	width: 70,
			    height: 70,
			    // 图片质量，只有type为`image/jpeg`的时候才有效。
			    quality: 70,
			    // 是否允许放大，如果想要生成小图的时候不失真，此选项应该设置为false.
			    allowMagnify: false
		    }
		});
		uploader.on('uploadBeforeSend', function(block,data) {
            // file为分块对应的file对象。
		    var filename = block.file.name;
		    console.log(filename);
		    // 修改data可以控制发送哪些携带数据。
		    data.file = filename;
        });
        uploader.on('uploadError', function() {
            alert('上传失败');
        });
        uploader.on('uploadSuccess', function(file,response) {
           console.log(response.data);
           $('#pdfm').find('.webuploader-pick').find('.icon-plus').hide();
           var str = '<div class="exhibition"><input type="hidden" class="pdfmValue" name="" value="'+response.data+'" /><img class="image-view" src="<%=imgServer%>'+response.data+'"/></div>';
           $('#pdfm').find('.webuploader-pick').html(str);
        });
        var uploader2 = WebUploader.create({
			// 选完文件后，是否自动上传。
		    auto: true,
		    // 文件接收服务端。
		    server: '<%=basePath %>/apply/upload',
		    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
		    pick: '#sfz',
		    // 参数
            formData: {file: ''},
		    // 去重复
            duplicate: false,
		    // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
		    resize: false,
		    // 只允许选择图片文件。
		    accept: {
		        extensions: 'gif,jpg,jpeg,bmp,png'
		    }
		});
		 uploader2.on('uploadError', function() {
			 alert('上传失败');
        });
        uploader2.on('uploadSuccess', function(file,response) {
           console.log(response.data);
           $('#sfz').find('.webuploader-pick').find('.icon-plus').hide();
           var str = '<div class="exhibition"><input type="hidden" class="sfzValue" name="" value="'+response.data+'" /><img class="image-view" src="<%=imgServer%>'+response.data+'"/></div>';
           $('#sfz').find('.webuploader-pick').html(str);
        });
         var uploader3 = WebUploader.create({
			// 选完文件后，是否自动上传。
		    auto: true,
		    // 文件接收服务端。
		    server: '<%=basePath %>/apply/upload',
		    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
		    pick: '#yyzz',
		    // 参数
            formData: {file: ''},
		    // 去重复
            duplicate: false,
		    // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
		    resize: false,
		    // 只允许选择图片文件。
		    accept: {
		        extensions: 'gif,jpg,jpeg,bmp,png'
		    },
			thumb: {
		    	width: 161,
			    height: 161,
			    // 图片质量，只有type为`image/jpeg`的时候才有效。
			    quality: 70,
			    // 是否允许放大，如果想要生成小图的时候不失真，此选项应该设置为false.
			    allowMagnify: false
		    }
		});
		 uploader3.on('uploadError', function() {
			 alert('上传失败');
        });
        uploader3.on('uploadSuccess', function(file,response) {
           $('#yyzz').find('.webuploader-pick').find('.icon-plus').hide();
           var str = '<div class="exhibition"><input type="hidden" class="yyzzValue" name="" value="'+response.data+'" /><img class="image-view" src="<%=imgServer%>'+response.data+'"/></div>';
           $('#yyzz').find('.webuploader-pick').html(str);
           inputValue();
        });
        function inputValue(){
	        var pdfmValue = $('.pdfmValue').val();var sfzValue = $('.sfzValue').val();
	        var yyzzValue = $('.yyzzValue').val();var pdmcValue = $('.pdmcValue').val();
	        var hyfl1 = $('.hyfl1').text();var hyfl2 = $('.hyfl2').find('span').text();
	        var hyfl3 = $('.hyfl3').text();var provinceName = $('.provinceName').text();
	        var cityName = $('.cityName').find('span').text();var areaName = $('.areaName').text();
	        var detailedAddress = $('.detailedAddress').val();//var jmidVaule = $('.jmidVaule').val();
	        var frxmVaule = $('.frxmVaule').val();var lxrsjVaule = $('.lxrsjVaule').val();
	       // var sfzVaule = $('.sfzVaule').val();var dgzhVaule = $('.dgzhVaule').val();
	        var yqmVaule = $('.yqm').val();var _inviteCode = $('.yqm').val();
	        var locationLon = $('body').data('locationLon');
	   	    var locationLat = $('body').data('locationLat');
	        console.log(pdfmValue+'11')
	        //if(locationLon&&locationLat&&pdfmValue&&yyzzValue&&pdmcValue&&hyfl1&&hyfl2&&hyfl3&&provinceName&&cityName&&areaName&&detailedAddress&&jmidVaule&&frxmVaule&&lxrsjVaule){
	       		//$('.ktBtn').removeClass('disableBtn');
	        //}
			if(locationLon&&locationLat&&pdfmValue&&yyzzValue&&pdmcValue&&hyfl1&&provinceName&&cityName&&areaName&&detailedAddress&&frxmVaule&&lxrsjVaule){
	       		$('.ktBtn').removeClass('disableBtn');
	        }else{
				$('.ktBtn').addClass('disableBtn');
			}
        }

        $("input[type='text']").on('blur', function(){
        	inputValue();
        })
		$("input[type='number']").on('blur', function(){
        	inputValue();
        })
		$("input[type='tel']").on('blur', function(){
        	inputValue();
        })

        /*验证*/
       		var reg = /^[1][34578]\d{9}$/;
            var _mpNum = $('.lxrsjVaule');
            _mpNum.on('blur', function(){
            	if (!reg.test($.trim(_mpNum.val()))) {
	        	    $.toast('您输入的手机号码格式不正确，手机号必须是11位数字');
					 _mpNum.val('');
            	}
            	inputValue();
            });
            /**
            var reg2 = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            var _sfzNum = $('.sfzVaule');
        	_sfzNum.on('blur', function(){
            	if (!reg2.test($.trim(_sfzNum.val()))) {
	        	    $.toast('请输入正确的身份证号');
					_sfzNum.val('');
            	}
            });
        	*/
			var reg3 = /^d+$/;
            //var _jmidVaule = $('.jmidVaule');
        	//_jmidVaule.on('input', function(){
            //	if (!reg3.test($.trim(_jmidVaule.val()))) {
	        //	    var replVal = _jmidVaule.val().replace(/[^\d]/g, '');
			//		_jmidVaule.val(replVal);
            //	}
            //});

        /*提交*/
       $('.ktBtn').click(function (){
       	   var pdfmValue = $('.pdfmValue').val();var sfzValue = $('.sfzValue').val();
           var yyzzValue = $('.yyzzValue').val();var pdmcValue = $('.pdmcValue').val();
           var hyfl1 = $('.hyfl1').text();var hyfl2 = $('.hyfl2').find('span').text();
           var hyfl3 = $('.hyfl3').text();var provinceName = $('.provinceName').text();
           var cityName = $('.cityName').find('span').text();var areaName = $('.areaName').text();
           var detailedAddress = $('.detailedAddress').val();
           //var jmidVaule = $('.jmidVaule').val();
           var frxmVaule = $('.frxmVaule').val();var lxrsjVaule = $('.lxrsjVaule').val();
           var sfzVaule = $('.sfzVaule').val();var dgzhVaule = $('.dgzhVaule').val();
           var yqmVaule = $('.yqm').val();var _inviteCode = $('.yqm').val();
       		if($(this).hasClass('disableBtn')){
       			if($('.pdfmValue').val() == undefined){
       				$.toast('请上传频道封面');
       				linkTo($('.chact-title'));
       				return false;
       			}
       			if($('.pdmcValue').val() == ""){
       				$.toast('请输入频道名称');
       				linkTo($('.pdmcValue'));
       				return false;
       			}
       			if($('.hyfl1').text() == ""){
       				$.toast('请选择行业分类');
       				linkTo($('.hyfn'));
       				return false;
       			}
       			if($('.provinceName').text() == ""){
       				$.toast('请选择城市');
       				linkTo($('.cityLink1'));
       				return false;
       			}
       			if($('.detailedAddress').val() == ""){
       				$.toast('请输入详细地址');
       				linkTo($('.detailedAddress'));
       				return false;
       			}
       			if($('body').data('locationLon') == undefined){
       				$.toast('请插入地图选择坐标');
       				linkTo($('.chanct-modify'));
       				return false;
       			}
//       			if($('.jmidVaule').val() == ""){
//       				$.toast('请输入频道居民ID');
//       				linkTo($('.jmidVaule'));
//       				return false;
//       			}
       			if($('.frxmVaule').val() == ""){
       				$.toast('请输入申请人姓名');
       				linkTo($('.frxmVaule'));
       				return false;
       			}
       			if($('.lxrsjVaule').val() == ""){
       				$.toast('请输入联系人手机号');
       				linkTo($('.lxrsjVaule'));
       				return false;
       			}
       			/**
       			if($('.sfzVaule').val() == ""){
       				$.toast('请输入身份证号码');
       				linkTo($('.sfzVaule'));
       				return false;
       			}

       			if($('.dgzhVaule').val() == ""){
       				$.toast('请输入对公账号');
       				linkTo($('.dgzhVaule'));
       				return false;
       			}
       			*/
       			if($('.yyzzValue').val() == undefined){
       				$.toast('请上传营业执照');
       				linkTo($('.idcard'));
       				return false;
       			}
       		}
       		$.ajax({
       			type:"post",
       			url:'<%=basePath %>/apply/post',
       			dataType:"json",
       			data:{
       				channelImg: pdfmValue,
       				channelName: pdmcValue,
       				firstIndustryId: $('body').data('hyfl1Code'),
       				secondIndustryId: $('body').data('city1Code'),
       				thirdIndustryId: $('body').data('are1Code'),
       				provinceCode: $('body').data('preCode'),
       				provinceCode: $('body').data('preCode'),
       				cityCode: $('body').data('ctCode'),
       				areaCode: $('body').data('areCode'),
       				channelAddress: detailedAddress,
       				locationLon: $('body').data('locationLon'),
       				locationLat: $('body').data('locationLat'),
       				//linkmanAccountId: jmidVaule,
       				legalPersonName: frxmVaule,
       				linkmanMobilePhone: lxrsjVaule,
       				//legalPersonSFZCode: sfzVaule,
       				//companyBankAccount: dgzhVaule,
       				//legalPersonSFZImg: "",
       				companyYYZZImg: yyzzValue,
       				//inviteCode: _inviteCode
       			},
       			success:function(data){
       				if(data.success){
						$('.windowDiv').show();
       				}
       			}
       		})
       })
	})
		</script>
	</body>

</html>
